export function useFlexible() {
  // flexible.js 内部实现
  const flexible = function (document: Document, window: Window): void {
    const docEl = document.documentElement;
    const resizeEvt =
      "orientationchange" in window ? "orientationchange" : "resize";
    const recalc = function (): void {
      const clientWidth = docEl.clientWidth / 24;
      if (!clientWidth) return;
      docEl.style.fontSize = clientWidth + "px";
    };
    recalc();
    if (!document.addEventListener) return;
    window.addEventListener(resizeEvt, recalc, false);
    document.addEventListener("DOMContentLoaded", recalc, false);
  };
  return {
    flexible,
  };
}
